<div class="applicationView">
    <br/>
    <h2>Pelamar Pekerjaan</h2>

    <?php //list of applicants ?>
    <?php if (count($models) > 0) { ?>
        <?php foreach($models as $model) { ?>
         <div class="row">
            <?php //Applicant information ?>
            <?php echo CHtml::link($model->getApplicant()->getName(), $model->getApplicant()->getLink()); ?>
            <?php if($model->status != ConstantsLookUp::$APPSTATUS_WAITING) { ?>
                <?php echo ' - ' . ConstantsLookUp::getJobStatus($model->status); ?>
            <?php } ?>

            <?php if($job->isApplicationActionable($model)) { ?>
                <?php //Accept application ?>
                <?php echo CHtml::beginForm($this->createUrl('acceptApplication')); ?>
                    <?php echo CHtml::hiddenField('id', $model->id); ?>
                    <?php echo CHtml::submitButton('Terima'); ?>
                <?php echo CHtml::endForm(); ?>

                <?php //Reject application ?>
                <?php echo CHtml::beginForm($this->createUrl('rejectApplication')); ?>
                    <?php echo CHtml::hiddenField('id', $model->id); ?>
                    <?php echo CHtml::submitButton('Tolak'); ?>
                <?php echo CHtml::endForm(); ?>
            <?php } ?>
        </div>
        <?php }

        }
        else{ ?>
    <font color="green">Belum ada yang melamar pekerjaan ini</font>
    <br/>
    <br/>
    <hr/>
    <?php 

    } ?>

    <?php //button to apply for job ?>
    <?php if($job->canApply()) { ?>
        <?php echo CHtml::beginForm($this->createUrl('apply')); ?>
            <?php echo CHtml::hiddenField('id', $job->id); ?>
            <?php echo CHtml::submitButton('Lamar Pekerjaan'); ?>
        <?php echo CHtml::endForm(); ?>
    <?php } ?>
</div>
